import { createRouter, createWebHistory } from 'vue-router'
import LoginPage from '@/views/LoginPage.vue'
import HomePage from '@/views/HomePage.vue'
import RegisterPage from '@/views/RegisterPage.vue' // 新增注册页面

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: LoginPage },
  { path: '/register', component: RegisterPage }, // 注册页面路由
  { path: '/home', component: HomePage },
  { path: '/app', component: () => import('@/App.vue') },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
